//
//  GMSm2k1Tests.m
//  GMObjC_Tests
//
//  Created by lif on 2020/7/10.
//  Copyright © 2020 lifei. All rights reserved.
//

#import "GMSm2v1Tests.h"

@interface GMSm2k1Tests : GMSm2v1Tests

@end

@implementation GMSm2k1Tests

- (void)setUp {
    [super setUp];
    [GMSm2Utils setEllipticCurveType:GMCurveType_secp256k1];
    
    self.gPubKey = @"044D5055D99F95BE6DF30F8C4BF3A6A5AF5B777847289A5F4F1A9197052E403968D79BCC6558F026ACDA72748F02426C9D023E9E71F59A0368AB2B3370325938A9";
    self.gPriKey = @"B3BDD054F0132FBD5D361C2E0D2BDEA81AB8C67CEC2D197A2EC4551D55353BB5";
    
    // 正确的加密后的数据
    self.gCipherText = @"306E02206CAB73B2A2096B7DF21326B6D9283BA8791C5673F9837FB9B4073B5CA256619602206C4441C221096052F3DC34623604CDFD9F9CE3CD3AC722CB3C9947CF5308DFA804208DC911C6A2C70795796560CA96228536D3BD9C0C2B3957A790755DBE8A1C845404062FFE785FDC18";
    self.gCipherHex = @"306F0221008A9F1EF990A8BF0C1A7D7E91FAB6D934DB6248599C1032EAE6F7903990E6EE5C02201CB6EDAF8A8C8911BC91FFDD5201947281303B9ECB325DC01E490C471C677C320420BEB83CADF5442763FEE40137C1C05739253FBECED39E10DD8B5926B27B4C289004061A4C1B7DD174";
    self.gCipherDataHex = @"306F022100FBE179F5DF01A7FDE04B7DC2CFAAC43088973D7FCF12E74554DDE85DB346A86302204F96A7B13B560D9DE5681E52439C4E3F037286438B7E4F679C1771FCAA71D41104200CA7D293D3F2573038470E87108B4C2BA20BB9FA8ADAA947FE74DD8F843744510406645C8AEAB7BB";
}

- (void)tearDown {
    self.gPubKey = nil;
    self.gPriKey = nil;
    self.gCipherHex = nil;
    self.gCipherHex = nil;
    self.gCipherDataHex = nil;
    [super tearDown];
}

///MARK: - 椭圆曲线类型
- (void)testEllipticCurveType {
    int currentType = [GMSm2Utils ellipticCurveType];
    XCTAssertTrue(currentType == GMCurveType_secp256k1, @"当前椭圆曲线应为 NID_secp256k1");
}

@end
